import {
    createRouter,
    createWebHashHistory
} from 'vue-router'
import home from "../view/home/index.vue"
import login from "../view/login/index.vue"
import layout from "../view/layout/index.vue"
import rankingList from "../view/rankingList/index.vue"
import songList from "../view/songList/index.vue"
import MVlist from "../view/MVlist/index.vue"
import singer from "../view/singer/index.vue"


const routes = [
    {
        path: '/',
        redirect: '/home',
        component: layout,
        children: [
            {
                path: 'home',
                name: 'home',
                component: home,
                meta: {
                    lable: "首页"
                }
            },
            {
                path: 'rankingList',
                name: 'rankingList',
                component: rankingList,
                meta: {
                    lable: "排行榜"
                }
            },
            {
                path: 'songList',
                name: 'songList',
                component: songList,
                meta: {
                    lable: "歌单"
                }
            },
            {
                path: 'MVlist',
                name: 'MVlist',
                component: MVlist,
                meta: {
                    lable: "歌单"
                }
            },
            {
                path: 'singer',
                name: 'singer',
                component: singer,
                meta: {
                    lable: "歌手"
                }
            }
        ]
    }, {
        path: "/login",
        name: "login",
        component: login
    }

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
